
// Import any other script files here, e.g.:
// import * as myModule from "./mymodule.js";
import baseNPC from './baseNPC.js'

runOnStartup(async runtime => {
	// Code to run on the loading screen.
	// Note layouts, objects etc. are not yet available.
	globalThis.rt = runtime;
	runtime.addEventListener("beforeprojectstart", () => OnBeforeProjectStart(runtime));
	runtime.objects.f_baseNPC.addEventListener("instancecreate", e => baseNPC.OnNPCCreate(e,runtime));
});

async function OnBeforeProjectStart(runtime) {
	// Code to run just before 'On start of layout' on
	// the first layout. Loading has finished and initial
	// instances are created and available to use here.

	runtime.addEventListener("tick", () => Tick(runtime));
	
}

function Tick(runtime) {
	// Code to run every tick


}